$(document).ready(function () {

    $("#login").on("click", function () {
        let username = $("#username").val();
        let password = $("#password").val();

        $.post("/user/login", {
            username: username,
            password: password
        }, function (resp) {
            if (resp.code === 200) {
                location.href = "/index.html";
            } else {
                alert(resp.message);
            }
        });
    });

});